package com.nf.health.app.sweat.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by he_pan on 2017/4/20.
 * The only genius that is worth anything is the genius for hard work
 *
 * @author he_pan
 * @Description 处理蓝牙数据结果bean
 */

public class ParseDataBean implements Serializable {
    private int type = -1;//类型 -1
    private String freq = "";
    private String errorMsg = "";
    private String measureTime;
    private List<Float> humList = new ArrayList<>();
    private List<Float> temList = new ArrayList<>();

    private String timeOfDay;//测量的日期
    private String timeOfhms;//测量的时分秒

    private int channelNum ;
    public ParseDataBean() {
    }

    public ParseDataBean(int type) {
        this.type = type;
    }

    public ParseDataBean(int type, String freq) {
        this.type = type;
        this.freq = freq;
    }

    public ParseDataBean(int type, List<Float> humList, List<Float> temList) {
        this.type = type;
        this.humList = humList;
        this.temList = temList;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public List<Float> getHumList() {
        return humList;
    }

    public void setHumList(List<Float> humList) {
        this.humList = humList;
    }

    public List<Float> getTemList() {
        return temList;
    }

    public void setTemList(List<Float> temList) {
        this.temList = temList;
    }


    public String getMeasureTime() {
        return measureTime;
    }

    public void setMeasureTime(String measureTime) {
        this.measureTime = measureTime;
    }

    public String getFreq() {
        return freq;
    }

    public void setFreq(String freq) {
        this.freq = freq;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public int getChannelNum() {
        return channelNum;
    }

    public void setChannelNum(int channelNum) {
        this.channelNum = channelNum;
    }

    public String getTimeOfDay() {
        StringBuilder builder = new StringBuilder();
        try {
            builder.append(measureTime.substring(0, 4));
            builder.append("-");
            builder.append(measureTime.substring(4, 6));
            builder.append("-");
            builder.append(measureTime.substring(6, 8));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return builder.toString();
    }


    public String getTimeOfhms() {
        StringBuilder builder = new StringBuilder();
        try {
            builder.append(measureTime.substring(8, 10));
            builder.append(":");
            builder.append(measureTime.substring(10, 12));
            builder.append(":");
            builder.append(measureTime.substring(12, 14));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return builder.toString();
    }

}
